
package controller;




import bo.BUS_ChiTietHoaDon;
import bo.BUS_HoaDon;
import com.opensymphony.xwork2.ActionSupport;
import dto.DTO_ChiTietHoaDon;
import dto.DTO_HoaDon;
import java.util.ArrayList;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts2.interceptor.ServletRequestAware;





public class QLHoaDonAction extends ActionSupport implements ServletRequestAware {

    private HttpServletRequest request;

    private ArrayList<DTO_HoaDon> dshd;
    private int chon;

    private String NgayLapHD;
    private String NgayGiaoHang;
    private String DiaChiGiaoHang;

    private int MaHD;
    private String HoTen;
    private int TrangThai;
    private ArrayList<DTO_ChiTietHoaDon> dscthd = new ArrayList<DTO_ChiTietHoaDon>();

    public ArrayList<DTO_ChiTietHoaDon> getDscthd() {
        return dscthd;
    }

    public void setDscthd(ArrayList<DTO_ChiTietHoaDon> dscthd) {
        this.dscthd = dscthd;
    }
    public String getDiaChiGiaoHang() {
        return DiaChiGiaoHang;
    }

    public void setDiaChiGiaoHang(String DiaChiGiaoHang) {
        this.DiaChiGiaoHang = DiaChiGiaoHang;
    }

    public String getHoTen() {
        return HoTen;
    }

    public void setHoTen(String HoTen) {
        this.HoTen = HoTen;
    }

    public int getMaHD() {
        return MaHD;
    }

    public void setMaHD(int MaHD) {
        this.MaHD = MaHD;
    }

    public String getNgayGiaoHang() {
        return NgayGiaoHang;
    }

    public void setNgayGiaoHang(String NgayGiaoHang) {
        this.NgayGiaoHang = NgayGiaoHang;
    }

    public String getNgayLapHD() {
        return NgayLapHD;
    }

    public void setNgayLapHD(String NgayLapHD) {
        this.NgayLapHD = NgayLapHD;
    }

    public int SetTrangThai() {
        return TrangThai;
    }

    public void setTrangThai(int TrangThai) {
        this.TrangThai = TrangThai;
    }

    public int getChon() {
        return chon;
    }

    public void setChon(int chon) {
        this.chon = chon;
    }

   

    

    public ArrayList<DTO_HoaDon> getDshd() {
        return dshd;
    }

    public void setDshd(ArrayList<DTO_HoaDon> dshd) {
        this.dshd = dshd;
    }


    public QLHoaDonAction() {

    }



    public String execute() throws Exception {

        BUS_HoaDon busHD = new BUS_HoaDon();
        dshd = busHD.LoadDSHD(chon);
        if(request.getParameter("GiaTriTim") != null){
            int MaHD = Integer.parseInt(request.getParameter("GiaTriTim"));
            BUS_ChiTietHoaDon busCTHD = new BUS_ChiTietHoaDon();
            dscthd = busCTHD.loadDSCTHD(MaHD);

        }
        


        return "success";

    }



    @Override
    public void setServletRequest(HttpServletRequest hsr) {
        request = hsr;
    }



}